<#assign className = table.entityName>   
<#if (module)?? && module!="">
package ${basePackage}.entity.${module};
<#else>
package ${basePackage}.entity;
</#if>

<#list table.columns as column>
<#if column.sqlTypeName == "DECIMAL">
import java.math.BigDecimal;
<#break>
</#if>
</#list>
<#list table.columns as column>
<#if column.simpleJavaType == "Date">
import java.util.Date;
<#break>
</#if>
</#list>


import com.wy2.core.tool.DatetimeTools;
import org.apache.commons.lang3.StringUtils;

/** 
<#if (table.remarks)?? && table.remarks!="">
 * ${className} 实体   ${table.remarks }
<#else>
 * ${className} 实体
</#if>
 * @author 你的名字
 * @date ${.now?string("yyyy年MM月dd日 HH:mm:ss")}
 *
 */
public class ${className} implements java.io.Serializable{
	private static final long serialVersionUID = 1L;
	<#list table.columns as column>
	<#if (column.remarks)?? && column.remarks!="">
	/**
	 * ${column.remarks }
	 */
	</#if>
	<#if column.sqlTypeName == "DECIMAL">
	private BigDecimal ${column.javaProperty};
	<#else>
	private ${column.simpleJavaType} ${column.javaProperty};
	</#if>
	</#list>
	
	@Override
	public String toString(){
		return <#list table.columns as column>"${column.javaProperty}:"+this.${column.javaProperty}<#if column_has_next>+","+</#if></#list>;
	}
	
	<#list table.columns as column>
	<#if column.sqlTypeName == "DECIMAL">
	public BigDecimal get${column.javaProperty?cap_first}() {
		return this.${column.javaProperty};
	}
	public void set${column.javaProperty}(BigDecimal value) {
		this.${column.javaProperty} = value;
	}
	
	<#else>
	public ${column.simpleJavaType} get${column.javaProperty?cap_first}() {
		<#if column.javaProperty == "createTime">		
		<#if column.simpleJavaType == "String">
		if(StringUtils.isBlank(this.${column.javaProperty})){
			set${column.javaProperty?cap_first}(DatetimeTools.getCurrentDatetime());
		}		
		<#elseif column.simpleJavaType == "Date">
		if(this.${column.javaProperty}==null){
			set${column.javaProperty?cap_first}(new Date());
		}		
		</#if>
		</#if>
		return this.${column.javaProperty};
	}
	public void set${column.javaProperty?cap_first}(${column.simpleJavaType} value) {
		this.${column.javaProperty} = value;
	}	
	</#if>
	</#list>
}